package com.kk.config;


import cloud.tianai.captcha.resource.ImageCaptchaResourceManager;
import cloud.tianai.captcha.resource.impl.DefaultImageCaptchaResourceManager;
import org.springframework.context.annotation.Bean;
/**
 * @author kl
 * @version 1.0
 * @description: TODO
 * @date 2025/10/17 上午10:02
 */
public class CaptchaConfig {
    /**
     * 自定义验证码生成器(可选)
     */
    @Bean
    public ImageCaptchaResourceManager imageCaptchaResourceManager() {
        // 配置自定义图片资源
        return new DefaultImageCaptchaResourceManager();
    }

//    /**
//     * 自定义验证码缓存(可选)
//     */
//    @Bean
//    @ConditionalOnProperty(name = "tianai.captcha.cache.type", havingValue = "redis")
//    public CaptchaStore<ImageCaptchaTrack> redisCaptchaStore(RedisTemplate<String, Object> redisTemplate) {
//        return new RedisCaptchaStore<>(redisTemplate, "captcha:", 300);
//    }
}
